#!/usr/bin/env node

const log = console.log,
      stdin = process.stdin, //标准输入流
      stdout = process.stdout, //标准输出流
      message = ['Name', 'Email', 'QQ', 'Mobile'];

let person = {},
    i = 1;

stdout.write(message[0] + ':');

stdin.on('data', (data)=>{
  person[message[i-1]] = data.slice(0, data.length-1).toString('utf8');
  if(i === 4) {
    log(person);
    process.exit();
  }

  stdout.write(message[i++] + ':');
});

stdin.on('end', ()=>{
  log(person);
})
